#include <func.h>

int main()
{
    if(fork()==0)
    {
        return 0;
    }
    else
    {
        int wstatus;
        wait(&wstatus);
        if(WIFEXITED(wstatus))
        {
            printf("exit normally exit code=%d\n",WEXITSTATUS(wstatus));
        }
        else if(WIFSIGNALED(wstatus))
        {
            printf("exit abnormally terminal signal=%d\n",WTERMSIG(wstatus));
        }
    }
    return 0;
}

